﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 派生类的构造函数
{
    class Father
    {
        public int x;
        public Father(int a)
        {
            x = a;
        }
    }
    class Son:Father
    {
        public int y;
        public Son(int a,int b):base(a)    //派生类构造函数的头
        {
            y = b;
        }
            
           
    }
    class Program
    {
        static void Main(string[] args)
        {
            Son s = new Son(10,20);
            int a = s.x;
            int b = s.y;
            Console.WriteLine("{0},{1}",a,b);

        }
    }
}
